<ion-header>
  <ion-toolbar>
    <ion-icon name="arrow-back" slot="start" (click)="goBack()"></ion-icon>
    <ion-title>修改密码</ion-title>
  </ion-toolbar>
</ion-header>

<ion-content>

  <ion-card>
    <ion-item>
      <ion-label>旧密码：</ion-label>
      <ion-input type="{{pwshow?'text':'password'}}" [(ngModel)]="oldPassword"  #name="ngModel" required placeholder="请输入当前密码：" clearInput></ion-input>
      <a href="javascript:;" (click)="pwshow=!pwshow" [ngClass]="pwshow?'eyeshow':'eyehide'">
        <ion-icon name="ios-eye-off" color="dark" class="eye-hide"></ion-icon>
        <ion-icon name="ios-eye" color="dark" class="eye-show"></ion-icon>　
      </a>
      <!-- 必填提醒  required #name="ngModel" -->
      <div *ngIf="name.invalid && (name.dirty || name.touched)" class="alert-danger">
        <div *ngIf="name.errors.required">
            必填
        </div>
      </div>
    </ion-item>
    <ion-item>
      <ion-label>新密码：</ion-label>
      <ion-input type="{{pwshow2?'text':'password'}}" [(ngModel)]="newPassword1" required #name2="ngModel" placeholder="请输入新密码：" minlength="6" maxlength="15" clearInput></ion-input>
      <a href="javascript:;" (click)="pwshow2=!pwshow2" [ngClass]="pwshow2?'eyeshow2':'eyehide2'">
        <ion-icon name="ios-eye-off" color="dark" class="eye-hide2"></ion-icon>
        <ion-icon name="ios-eye" color="dark" class="eye-show2"></ion-icon>　
      </a>
      <!-- 必填提醒  required #name2="ngModel" -->
      <div *ngIf="name2.invalid && (name2.dirty || name2.touched)" class="alert-danger">
        <div *ngIf="name2.errors.required">
            必填
        </div>
      </div>
    </ion-item>
    <ion-item>
      <ion-label>确认密码：</ion-label>
      <ion-input type="{{pwshow3?'text':'password'}}" [(ngModel)]="newPassword2" required #name3="ngModel" placeholder="再次输入新密码：" maxlength="15" clearInput></ion-input>
      <a href="javascript:;" (click)="pwshow3=!pwshow3" [ngClass]="pwshow3?'eyeshow3':'eyehide3'">
        <ion-icon name="ios-eye-off" color="dark" class="eye-hide3"></ion-icon>
        <ion-icon name="ios-eye" color="dark" class="eye-show3"></ion-icon>　
      </a>
      <!-- 必填提醒  required #name3="ngModel" -->
      <div *ngIf="name3.invalid && (name3.dirty || name3.touched)" class="alert-danger">  
        <div *ngIf="name3.errors.required">
            必填
        </div>
      </div>
    </ion-item>
    <p> &nbsp;&nbsp;&nbsp; *请设置6位以上的密码</p>
    <br>
    <section>
      <ion-button expand="block" class="submit_btn" (click)="confirm()">确认</ion-button>
    </section>
    <br>

  </ion-card>
</ion-content>